package com.iphone.extra;

import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.util.AttributeSet;

import com.iphone.extra.view.IWidgetFrameLayout;
import com.iphone.extra.view.ShortcutWidgetLayout;

public class WidgetIPodLayout extends IWidgetFrameLayout {

    public WidgetIPodLayout(Context context) {
        this(context, null, 0);
    }

    public WidgetIPodLayout(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public WidgetIPodLayout(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    public boolean onCellClicked(String describe) {
        try {
            Intent intent = new Intent();
            intent.setClassName("com.google.android.apps.magazines", "com.google.apps.dots.android.app.activity.CurrentsStartActivity");
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
            getContext().startActivity(intent);
            getContext().sendBroadcast(new Intent(ShortcutWidgetLayout.ACTION));
            return true;
        } catch (Exception e) {
        }
        return false;
    }

    @Override
    public String getLabel(Resources res) {
        return res.getString(R.string.widget_label_ipod);
    }
}
